#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <time.h>

int main ()
{
	int K=0,N,i;
	long double pi, x, y ;
	srand(time(NULL));
	printf ("vvedite chislo tochek': ");
	scanf("%d",&N);

	for (i=1; i<=N; i++)
	{
		x = rand();
		y = rand();
		if ((  x*x + y*y  ) < RAND_MAX * RAND_MAX )
			K++;
	}

	pi=4*(long double)K/(long double)N;
	printf("Chislo pi = %Lg ", pi);
	system ("pause");
}
